package com.mightykiwi.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="PRODUCT")
public class Product {

	@Id
	@Column(name="PRODUCT_ID")
	private int id;
	@Column(name="PRODUCT_LIB")
	private String libelle;
	@Column(name="PRODUCT_DESC")
	private String description;
	@Column(name="PRODUCT_AMAZ_URL")
	private String amazon_url;
	@Column(name="PRODUCT_PRICE")
	private double price;

	public Product() {
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public String getLibelle() {
		return libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getAmazon_url() {
		return amazon_url;
	}

	public void setAmazon_url(String amazon_url) {
		this.amazon_url = amazon_url;
		this.setId(this.amazon_url.hashCode());
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
}
